import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class PavoGigante here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class PavoGigante extends Pavo
{
    int cont;
    int dir=1;
    GreenfootImage[] imag=new GreenfootImage[2];
    /**
     * Act - do whatever the PavoGigante wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public PavoGigante(int d){
     super(d);
     cont=0;
     imag[0]=new GreenfootImage("giantTurkey.png");
     imag[1]=new GreenfootImage("giantTurkey.png");
     imag[1].mirrorHorizontally();
     }
    public void act() 
    {
        if(dir==1){
        setImage(imag[0]);
        setLocation(getX()+1,getY());
        if(cont>=250){
         cont=0;
         dir=-1;
        }
        }
        
        if(dir==-1){
            
            setImage(imag[1]);
            setLocation(getX()-1,getY());
            if(cont>=250){
            cont=0;
            dir=1;
        }}
        cont++;
    }    
}
